

    require(['./config'],()=>{
        require(['template','request','header','footer','jquery'],(template,req)=>{
            class List{
                constructor(){
                    this.init()
                }
                //定义一个方法拿到地址栏的id然后发送请求
                    init(){
                       const id = window.location.search.split('=')[1]
                       //发送请求
                       req.getListData(id)
                       .then(res=>{
                        //    console.log(res)
                        if(res.code === 200){
                            //渲染页面 
                            this.render(res.data.items)
                        }
                       })
                    }
                render(res){
                    // console.log(title)
                    //先把list数据结构出来
                    const {list} = res
                    // console.log(list)
                  
                    $('.moreCake>ul').html(template
                        ('listTemplate',{list}))
                }
            }
            return new List()
        })
    })